/*
 * FXGL - JavaFX Game Library. The MIT License (MIT).
 * Copyright (c) AlmasB (almaslvl@gmail.com).
 * See LICENSE for details.
 */

package com.windea.study.kotlin.fxgl.sample.sandbox.trade

import com.almasb.fxgl.app.*
import com.almasb.fxgl.dsl.*
import com.almasb.fxgl.entity.*
import com.almasb.fxgl.input.*
import com.windea.study.kotlin.fxgl.sample.dev.*
import dev.*
import javafx.scene.input.*
import javafx.scene.shape.*

/**
 *
 *
 * @author Almas Baimagambetov (AlmasB) (almaslvl@gmail.com)
 */
class ShopSample : GameApplication() {
	
	var player: Entity? = null
		private set
	
	private var shopState: ShopState? = null
	
	private enum class Type {
		PLAYER
	}
	
	override fun initSettings(settings: GameSettings) {
		settings.width = 1280
		settings.height = 720
		settings.title = "ShopSample"
		settings.version = "0.1"
	}
	
	override fun initInput() {
		getInput().addAction(object : UserAction("Open Shop Menu") {
			override fun onActionBegin() {
				getGameController().pushSubScene(shopState!!)
			}
		}, KeyCode.F)
	}
	
	override fun initGame() {
		shopState = ShopState()
		
		player = entityBuilder()
			.type(Type.PLAYER)
			.at(100.0, 100.0)
			.view(Rectangle(40.0, 40.0))
			.with(DeveloperWASDControl())
			.buildAndAttach()
	}
}


fun main(args: Array<String>) {
	GameApplication.launch(ShopSample::class.java, args)
}
